const userRules = {
  name: [
    {
      required: true,
      message: "用户名是必传内容~",
      trigger: "blur"
    }
  ],
  password: [
    {
      required: true,
      message: "密码是必传内容~",
      trigger: "blur"
    },
    {
      pattern: /^[a-z0-9]{5,}$/,
      message: "密码必须是5位以上的字母或者数字~",
      trigger: "blur"
    }
  ]
};

const iphoneRules = {
  iphone: [
    {
      required: true,
      message: "手机号是必传内容~",
      trigger: "blur"
    },
    {
      len: 11,
      message: "请输入正确的电话号码",
      trigger: "blur"
    }
  ],
  code: [
    {
      required: true,
      message: "验证码是必传内容~",
      trigger: "blur"
    },
    {
      len: 6,
      message: "请输入正确的验证码",
      trigger: "blur"
    }
  ]
};

export { userRules, iphoneRules };
